<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "kd_message".
 *
 * @property integer $mid
 * @property string $title
 * @property string $receiver
 * @property string $content
 * @property string $image
 * @property integer $bid
 * @property integer $yid
 * @property string $feedback_type
 * @property string $addtime
 */
class Message extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'kd_message';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['title', 'receiver', 'content', 'bid', 'yid'], 'required'],
            [['content'], 'string'],
            [['bid', 'yid'], 'integer'],
            [['addtime'], 'safe'],
            [['title', 'feedback_type'], 'string', 'max' => 15],
            [['receiver'], 'string', 'max' => 10],
            [['image'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'mid' => '序号',
            'title' => '标题',
            'receiver' => '发送对象',
            'content' => '正文',
            'image' => '图片',
            'bid' => '所属班级id',
            'yid' => '所属幼儿园id',
            'feedback_type' => '反馈类型',
            'addtime' => '发布时间',
        ];
    }
}
